package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserDao {
    /**
     * 查询所有数据
     * @return 数据集合
     */
    List<User> findAll();

    void save(User user);

    User findById(String id);

    void update(User user);

    void delete(String s);

    void deleteRoleAssociationByUserId(String id);

    void deleteUserAndRoles(String userId);

    void saveUserAndRoles(@Param("userId")String userId,@Param("roleId")String role);

    User findByEmailAndPassword(@Param("email") String username,@Param("password") String password);
}
